<template>
    <div>
        <span>我是子组件1,我获取到的共享是：{{ state_shareNum }}</span>
        <el-button @click="onClick">+5</el-button>
    </div>
</template>

<script>
    export default {
        computed:{
            state_shareNum(){
                return this.$store.state.shareNum
            }
        },
        methods:{
            onClick(){
                this.$store.dispatch('change_num',5)
            }
        }
    }
</script>

<style lang="scss" scoped>

</style>
